﻿@model PsCommandDtls

@using (Html.BeginForm("EditDetail", "CommandDismiss", FormMethod.Post))
{
    @* @Html.AntiForgeryToken() *@
    @Html.ValidationSummary(true)
    <h3 class="header">แก้ไขรายชื่อในคำสั่ง</h3>
    <div class="detail">
        <h3><label id="lblCmdTypeName"></label></h3>
        @Html.HiddenFor(model => model.CmdId)
        @Html.HiddenFor(model => model.CmdDtlsId)

        <table class="info">
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.EmpId)
                </td>
                <td class="editor-field">
                    @(Html.Telerik().ComboBoxFor(m => m.EmpId)
                        .BindTo(new SelectList(new GERPContext(true).Employees
                            .OrderBy(m => m.FirstName)
                            .OrderBy(m => m.LastName)
                            .Where(m => m.RecordStatus != "D" && m.MasEmployeeStatus.Active == "1")
                            .ToList(), "EmpId", "FullName"))
                        //.SelectedIndex(Model != null ? (model.HrmPsCommandDtls.EmpId != null ? model.HrmPsCommandDtls.EmpId.Value : -1) : -1)
                        .HighlightFirstMatch(true)
                        .Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.Contains))
                    )
                    @Html.ValidationMessageFor(model => model.EmpId)
                </td>
            </tr>
            <tr class="left">
                <td class="editor-label">
                    @Html.LabelFor(model => model.StartDate)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.StartDate)
                    @Html.ValidationMessageFor(model => model.StartDate)
                </td>
            </tr>
            @*
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.EndDate)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.EndDate)
                    @Html.ValidationMessageFor(model => model.EndDate)
                </td>
            </tr>*@
            <tr class="left">
                <td class="editor-label">
                    @Html.LabelFor(model => model.Remarks)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.Remarks)
                    @Html.ValidationMessageFor(model => model.Remarks)
                </td>
            </tr>
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.RptRemarks)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.RptRemarks)
                    @Html.ValidationMessageFor(model => model.RptRemarks)
                </td>
            </tr>
        </table>
    
    <p id="pnlCommand2">
        <input type="submit" value="บันทึก" />&nbsp;&nbsp;<a id="lnkEditCancel" title="คลิกเพื่อยกเลิกการแก้ไข" >ยกเลิก</a>
    </p>
    </div>
}